<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Logout extends CI_Controller {

	function __construct()
	{
		parent::__construct();
	}

	public function index()
	{
		$this->load->helper('url');
		if(isset($_COOKIE['username'])){
			setcookie('username',null,time()-1);
			setcookie('auth',null,time()-1);
			echo "<script language='javascript' type='text/javascript'>";
			echo 'alert("注销成功!");';
			echo "</script>";
			redirect('?count=0','refresh');
		}else{
			echo "<script language='javascript' type='text/javascript'>";
			echo 'alert("未登录!");';
			echo "</script>";
			redirect('?count=0','refresh');
		}
	}

}
?>